.class public Lorg/microemu/app/util/MIDletResourceInputStream;
.super Ljava/io/InputStream;
.source "MIDletResourceInputStream.java"


# instance fields
.field private is:Ljava/io/InputStream;


# direct methods
.method public constructor <init>(Ljava/io/InputStream;)V
    .locals 0
    .parameter "is"

    .prologue
    .line 40
    invoke-direct {p0}, Ljava/io/InputStream;-><init>()V

    .line 41
    iput-object p1, p0, Lorg/microemu/app/util/MIDletResourceInputStream;->is:Ljava/io/InputStream;

    .line 42
    return-void
.end method


# virtual methods
.method public available()I
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 45
    iget-object v0, p0, Lorg/microemu/app/util/MIDletResourceInputStream;->is:Ljava/io/InputStream;

    invoke-virtual {v0}, Ljava/io/InputStream;->available()I

    move-result v0

    return v0
.end method

.method public read()I
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 49
    iget-object v0, p0, Lorg/microemu/app/util/MIDletResourceInputStream;->is:Ljava/io/InputStream;

    invoke-virtual {v0}, Ljava/io/InputStream;->read()I

    move-result v0

    return v0
.end method

.method public read([B)I
    .locals 5
    .parameter "b"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    const/4 v4, -0x1

    .line 53
    const/4 v1, 0x0

    .line 54
    .local v1, result:I
    const/4 v0, 0x0

    .line 56
    .local v0, count:I
    :cond_0
    iget-object v2, p0, Lorg/microemu/app/util/MIDletResourceInputStream;->is:Ljava/io/InputStream;

    array-length v3, p1

    sub-int/2addr v3, v1

    invoke-virtual {v2, p1, v1, v3}, Ljava/io/InputStream;->read([BII)I

    move-result v0

    .line 57
    if-eq v0, v4, :cond_1

    .line 58
    add-int/2addr v1, v0

    .line 59
    array-length v2, p1

    if-ne v1, v2, :cond_2

    move v2, v1

    .line 67
    :goto_0
    return v2

    .line 62
    :cond_1
    if-eqz v1, :cond_2

    move v2, v1

    .line 63
    goto :goto_0

    .line 65
    :cond_2
    if-ne v0, v4, :cond_0

    move v2, v4

    .line 67
    goto :goto_0
.end method
